using System;
using System.Collections;
using System.Collections.Generic;
using Mgrs;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;

/**药箱界面 */
public class KitPanel : MonoBehaviour, IPointerClickHandler
{
    public Button btnCardBag;
    public Button btnMaterialBook;
    public Button btnSymptomBook;
    
    public void Awake()
    {
        btnCardBag.onClick.AddListener(OnBtnCardBag);
        btnMaterialBook.onClick.AddListener(OnBtnMaterialBook);
        btnSymptomBook.onClick.AddListener(OnBtnSymptomBook);
    }

    // Start is called before the first frame update
    void Start()
    {
     
    }

    // Update is called once per frame
    void Update()
    {
        
    }

    public void OnPointerClick(PointerEventData eventData)
    {
        // 关闭界面
        Destroy(gameObject);
    }
    
    private void OnBtnCardBag()
    {
        PanelMgr.OpenBackpack(transform.parent);
        Destroy(gameObject);
    }
    
    private void OnBtnMaterialBook()
    {
        PanelMgr.OpenHerbPanel(transform.parent);
        Destroy(gameObject);
    }
    
    private void OnBtnSymptomBook()
    {
        PanelMgr.OpenDiseasePanel(transform.parent);
        Destroy(gameObject);
    }
}
